<template>
	<!--指派单人-->
	<view class="page-content">
		<scroll-view class="page-body" :scroll-top="scrollTop" scroll-y="true" @scrolltolower="loadmore()">
			<!--动态-->
			<template v-if="sel_data && sel_data.length > 0 ">
				<block v-for="(item,index) in sel_data" :key="index">
					<view class="body-box" @click.stop="tosel(item)">
						<con-li :obj="item"></con-li>
					</view>
				</block>
				<!-- 上拉加载 -->
				<view class="det-con-more">
					<load-more :loadmore="load_more1"></load-more>
				</view>
			</template>
			<!--无数据-->
			<empty v-else no-full type="noData"></empty>
		</scroll-view>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapActions
	} from "vuex";
	import {
		getDesignators, //指派
	} from '@/common/api.js';
	import loadMore from '@/components/uni-load-more/load-more.vue';
	import conLi from '@/pages/components/contact_li.vue';
	export default{
		components: {
			loadMore,conLi
		},
		data(){
			return {
				scrollTop: 0,
				noData: false,
				load_more1: '', //下拉加载文字
				load_sta: false, //是否是加载状态
				sel_data:[],
				type:'',
				id:'',
				params:{
					flow_path_id:'',
					company_id:'',
					id:''
				}
			}
		},
		computed: {
			...mapGetters(['companyInfo', 'userInfo']),
		},
		onShow() {
			this.params.company_id = this.companyInfo.id;
			this.getdata();
		},
		onLoad(option){
			console.log(222,option)
			if(option.flow_path_id){
				this.params.flow_path_id = option.flow_path_id;
			}
			if(option.type){
				this.type = option.type;
			}
		},
		methods:{
			getdata(){
				getDesignators(this.params).then(res=>{
					if(res.code === 2000){
						this.sel_data = res.data;
					}
				})
			},
			tosel(item){
				this.$util.prePage().resdata2(item);
				setTimeout(() => {
					uni.navigateBack({
						delta: 1,
					})
				}, 500)
			},
			loadmore(){
				
			},
		}
	}
</script>

<style lang="scss">
	.page-content{
		width: 100vw;
		height: 100%;
		background: $uni-bg-color-grey;
		.page-body{
			display: flex;
			height: 100%;
			padding-top: 30rpx;
			.body-box{
				display: flex;
				flex-direction: column;
				background: $uni-bg-color;
				padding: 0 30rpx;
			}
			.con-text {
				display: flex;
				flex-direction: column;
				font-size: 28rpx;
				color: #666;
				line-height: 50rpx;
				image{
					width: 100%!important;
					max-width: 100%!important;
				}
			}
		}
	}
</style>
